App.Binder = (function(lng, App) {

    var $ = lng.dom;
    var section_binder = [];

    /**
     * 页面预定义的组件绑定加载(通过binder)
     * @param {type} bind_list
     * @returns {undefined}
     */
    var bindData = function(bind_list) {
        var list = bind_list || section_binder;
        for (var key in list) {
            var data = list[key];
            bindToSection(key, data);
        }
        $('a.icon-back').bind('touchend', App.Router.goBack);
    };

    /**
     * 批量增加某个section页的组件绑定
     * @param {type} section_id
     * @param {type} bind_list
     * @returns {undefined}
     */
    var bindToSection = function(section_id, bind_list) {
        var selector_page = 'section#' + section_id;
        var $_page = $(selector_page);
        for (var selector in bind_list) {
            var $_div = $_page.find(selector);
            // 使用touchend比click响应快速
            $_div.bind('touchend', bind_list[selector]);
        }
    };

    return{
        section_binder: section_binder,
        bindData: bindData,
        bindToSection: bindToSection
    };

})(Lungo, App);